var columns = require('./columns');
var balance = require('../balance/main');

return extend(balance, {
    target:'#balance-amt',
    path:'/balance-amt/',
    data:{
        
    },
    template:{
        title:renders({
            <h3 class="title f-fs20 f-tac">数量金额<%title??%></h3>
        }),
        left:renders({
            <%include 'date'%>
        }),
        mode:renders({
            <%if isAccount?? && isCurray??%>
            <%var html = html + '<option value="1">数量外币式</option>'%>
            <%/if%>
            <select name="mode" data-css="width:110px;" class="f-dn">
                <option value="0">数量金额式</option>
                <%html??%>
            </select>
        })
    },
    grid:{
        columns:columns()
    },
    setTitle:function(){
        var data = this.getQuery();
        var title = '数量金额';
        if(data.mode == '1'){
            title = '数量外币';
        }
        balance.setTitle.call(this, title + this.data.title);
    },
    renderCol:function(){
        var data = this.getQuery();
        this.setTitle();
        this.datagrid.option('columns', columns(data.mode, data.showYear))
    }
})